from django.db import models


class CsOrderDetails(models.Model):
    order_id = models.PositiveIntegerField()
    goods_id = models.PositiveIntegerField()
    goods_name = models.CharField(max_length=100)
    barcode = models.CharField(max_length=64)
    amount = models.DecimalField(max_digits=12, decimal_places=3)
    selling_price = models.DecimalField(max_digits=10, decimal_places=2)
    spec_typ = models.PositiveIntegerField()
    is_input_price = models.IntegerField(default=0)
    is_discount = models.IntegerField(default=0)
    subtotal_raw = models.DecimalField(default=0, max_digits=10, decimal_places=2)
    subtotal = models.DecimalField(max_digits=10, decimal_places=2)
    stock_prev = models.DecimalField(max_digits=12, decimal_places=3)
    stock_next = models.DecimalField(max_digits=12, decimal_places=3)
    return_num = models.DecimalField(max_digits=12, decimal_places=3)
    return_order_id = models.PositiveIntegerField()
    status = models.IntegerField()
    created = models.PositiveIntegerField()
    updated = models.PositiveIntegerField()
    deleted = models.PositiveIntegerField(default=0)

    class Meta:
        managed = False
        db_table = 'cs_order_details'
